home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / fsioPipe.h < prev    next >
C/C++ Source or Header  |  1990-12-08  |  4KB  |  96 lines

  1. /*
  2.  * fsioPipe.h --
  3.  *
  4.  *    Declarations for anonymous pipe access.
  5.  *
  6.  * Copyright 1987 Regents of the University of California
  7.  * All rights reserved.
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /sprite/src/kernel/fsio/RCS/fsioPipe.h,v 9.2 90/12/06 21:56:56 jhh Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _FSIOPIPE
  20. #define _FSIOPIPE
  21.  
  22. #include <fsio.h>
  23. /*
  24.  * The I/O descriptor for a local anonymous pipe: FSIO_LCL_PIPE_STREAM.
  25.  */
  26.  
  27. typedef struct Fsio_PipeIOHandle {
  28.     Fs_HandleHeader    hdr;        /* Standard handle header. The 'major'
  29.                      * field of the fileID is a generation
  30.                      * number. 'minor' field is unused. */
  31.     List_Links        clientList;    /* Client use info needed to allow
  32.                      * remote access after migration. */
  33.     Fsio_UseCounts        use;        /* Summary reference counts. */
  34.     int            flags;        /* FSIO_PIPE_READER_GONE, FSIO_PIPE_WRITER_GONE */
  35.     int            firstByte;    /* Indexes into buffer. */
  36.     int            lastByte;
  37.     int            bufSize;    /* Total number of bytes in buffer */
  38.     Address        buffer;        /* The buffer for the data. */
  39.     List_Links        readWaitList;    /* For the waiting readers of the pipe*/
  40.     List_Links        writeWaitList;    /* For the waiting writers on the pipe*/
  41. } Fsio_PipeIOHandle;            /* 68 BYTES */
  42.  
  43. #define FSIO_PIPE_READER_GONE    0x1
  44. #define FSIO_PIPE_WRITER_GONE    0x2
  45.  
  46. /*
  47.  * When a client re-opens a pipe it sends the following state to the server.
  48.  */
  49. typedef struct Fsio_PipeReopenParams {
  50.     Fs_FileID    fileID;        /* File ID of pipe to reopen. MUST BE FIRST */
  51.     Fsio_UseCounts use;        /* Recovery use counts */
  52. } Fsio_PipeReopenParams;
  53.  
  54. /*
  55.  * Stream operations.
  56.  */
  57.  
  58. extern ReturnStatus Fsio_PipeRead _ARGS_((Fs_Stream *streamPtr, 
  59.     Fs_IOParam *readPtr, Sync_RemoteWaiter *waitPtr, Fs_IOReply *replyPtr));
  60. extern ReturnStatus Fsio_PipeWrite _ARGS_((Fs_Stream *streamPtr, 
  61.     Fs_IOParam *writePtr, Sync_RemoteWaiter *waitPtr, 
  62.     Fs_IOReply *replyPtr));
  63. extern ReturnStatus Fsio_PipeIOControl _ARGS_((Fs_Stream *streamPtr, 
  64.     Fs_IOCParam *ioctlPtr, Fs_IOReply *replyPtr));
  65. extern ReturnStatus Fsio_PipeSelect _ARGS_((Fs_HandleHeader *hdrPtr, 
  66.     Sync_RemoteWaiter *waitPtr, int *readPtr, int *writePtr, 
  67.     int *exceptPtr));
  68. extern ReturnStatus Fsio_PipeGetIOAttr _ARGS_((Fs_FileID *fileIDPtr, 
  69.     int clientID, register Fs_Attributes *attrPtr));
  70. extern ReturnStatus Fsio_PipeSetIOAttr _ARGS_((Fs_FileID *fileIDPtr, 
  71.     Fs_Attributes *attrPtr, int flags));
  72. extern ReturnStatus Fsio_PipeMigClose _ARGS_((Fs_HandleHeader *hdrPtr, 
  73.     int flags));
  74. extern ReturnStatus Fsio_PipeMigrate _ARGS_((Fsio_MigInfo *migInfoPtr, 
  75.     int dstClientID, int *flagsPtr, int *offsetPtr, int *sizePtr, 
  76.     Address *dataPtr));
  77. extern ReturnStatus Fsio_PipeMigOpen _ARGS_((Fsio_MigInfo *migInfoPtr, 
  78.     int size, ClientData data, Fs_HandleHeader **hdrPtrPtr));
  79. extern ReturnStatus Fsio_PipeReopen _ARGS_((Fs_HandleHeader *hdrPtr, 
  80.     int clientID, ClientData inData, int *outSizePtr, 
  81.     ClientData *outDataPtr));
  82. extern void Fsio_PipeClientKill _ARGS_((Fs_HandleHeader *hdrPtr, int clientID));
  83. extern Boolean Fsio_PipeScavenge _ARGS_((Fs_HandleHeader *hdrPtr));
  84.  
  85. #ifdef SOSP91 
  86. extern ReturnStatus Fsio_PipeClose _ARGS_((Fs_Stream *streamPtr, int clientID,
  87.     Proc_PID procID, int flags, int dataSize, ClientData closeData,
  88.     int *offsetPtr, int *rwFlagsPtr));
  89. #else
  90. extern ReturnStatus Fsio_PipeClose _ARGS_((Fs_Stream *streamPtr, int clientID,
  91.     Proc_PID procID, int flags, int dataSize, ClientData closeData));
  92. #endif
  93.  
  94.  
  95. #endif /* _FSIOPIPE */
  96.